package com.jml.service;



import com.jml.entity.DispatchEntity;
import com.jml.mapper.DispatchMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;


@Component
public class DistributeService {
    @Autowired
    private DispatchMapper dispatchMapper;


    @Transactional
    public String distributeOrder(String orderId) {
//        BrokerConfig
        // 获取请求事务id
        DispatchEntity dispatchEntity = new DispatchEntity(orderId, 123456L);
        dispatchMapper.insertDistribute(dispatchEntity);
        return "插入数据成功";
    }
}
